package com.itheima.day06_API.Test5;

public class Employ {
    private String name;
    private  int age;

    public Employ() {
    }

    public Employ(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Employ{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Employ employ = (Employ) o;

        if (age != employ.age) return false;
        return name != null ? name.equals(employ.name) : employ.name == null;

    }
}
